home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Presentations
/
Presentations ’88
/
Feldt Advanced Mac Programming
/
Serial Port
/
lib src
/
XTEvent.c
< prev
next >
Wrap
Text File
|
1987-10-26
|
2KB
|
72 lines
/* ssg Commlib - XTEvent */
/* Aztec C compiler 1.06i */
/* Lightspeed C compiler 2.01 */
/* Copyright © 1985,1986,1987 by small systems guild. All rights reserved.*/
#include <extender.h> /* include Commlib and standard Toolbox headers */
void XTendInit()
{
MoreMasters(); /* allocate a 256 byte master pointer block */
MoreMasters(); /* which will hold up to 64 master pointers */
MoreMasters(); /* a master pointer is required for every */
MoreMasters(); /* handle, which can easily be hundreds! */
/* If you don't allocate them now they will */
/* be automatically by the memory manager */
/* as needed, causing heap fragmentation */
InitGraf(&thePort); /* initialize quickdraw and initial grafport*/
InitFonts(); /* initialize the font manager */
InitWindows(); /* initialize the window manager */
InitMenus(); /* initialize the menu manager */
TEInit(); /* initialize textedit */
InitDialogs(NULL); /* initialize dialog manager after quickdraw*/
/* window manager, dialog manager & textedit*/
FlushEvents(everyEvent,NULL); /* remove all pending events from queue */
InitCursor(); /* set cursor to the arrow pattern */
}
Boolean XTGetNextEvent(eventMask,theEvent)
int eventMask;
EventRecord *theEvent;
{
Boolean dummy;
DialogPtr DP;
int item;
if (GetNextEvent(eventMask,theEvent)) /* if there is an event on the queue*/
return(TRUE); /* return immediately to HandleEvent*/
else {
if (((WindowPeek)FrontWindow())->windowKind == dialogKind) {
dummy = IsDialogEvent(theEvent);
dummy = DialogSelect(theEvent,&DP,&item);
}
return(FALSE);
}
}
void InitEvtStuff(ES)
EventStuff *ES;
{
ES->WhichWindow = NULL;
ES->WindowPart = -1;
ES->WhichDialog = NULL;
ES->DialogItem = 0;
ES->WhichControl = NULL;
ES->ControlPart = 0;
ES->WhichList = NULL;
ES->ListPart = -1;
SetPt(&(ES->WhichCell),-1,-1);
ES->MenuH = NULL;
ES->MenuNum = 0;
ES->ItemNum = 0;
ES->TEH = NULL;
ES->ch = '\0';
ES->SizeChanged = FALSE;
ES->WindowIsNew = FALSE;
ES->LastMouseDown.when = NULL;
ES->DoubleClick = FALSE;
ES->DialogEvent = FALSE;
}